package com.king.netty.dubbo.provider;

import com.king.netty.dubbo.publicinterface.HelloService;

public class HelloServiceImpl implements HelloService {

    private static int count = 0;

    /**
     * 当有消费者调用该方法时，返回一个结果
     *
     * @param msg 客户端发送的消息
     * @return java.lang.String
     * @author king
     * @date 2021-04-13 15:42
     */
    @Override
    public String hello(String msg) {
        System.out.printf("收到客户端消息 = %s\n", msg);

        if (null != msg) {
            return "你好客户端，我已经收到你的消息【" + msg + "】" + (++count);
        } else {
            return "你好客户端，我已经收到你的消息【】";
        }
    }
}
